package com.example.apple.paopo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.orhanobut.logger.Logger;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by apple on 17/12/10.
 */
public class mFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private FragmentManager fm;
    public mFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fm = fm;
        this.fragments = fragments;
    }
    @Override
    public Fragment getItem(int position) {
      //  Logger.d(String.valueOf(position));
        return fragments.get(position);
    }


    @Override
    public int getCount() {
       // Logger.d(String.valueOf(fragments.size()));
        return fragments.size();
    }
}
